package com.market.manager;

import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

public interface SystemManager {
	/**
	 * When remove a product from order, only remove the reference, but
	 * orderDetail will not be removed from orderDetail table. This method
	 * remove all orderDetails that are not referenced by any order.
	 */
	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = RuntimeException.class)
	public void cleanOrderDetail();

	/**
	 * When remove a product from purchase, only remove the reference, but
	 * purchaseDetaill will not be removed from purchase, This method remove all
	 * purchaseDetails that are not referenced by any purchase.
	 */
	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = RuntimeException.class)
	public void cleanPurchaseDetail();

	/**
	 * When remove a pickupSchedule from location, only remove the reference,
	 * but that pickupSchedule will not be removed from table pickupSchedule,
	 * This method remove all pickupSchedule that are not referenced by any
	 * purchase.
	 */
	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = RuntimeException.class)
	public void cleanPickupSchedule();

	/**
	 * When remove a purchaseSchedule from product, only remove the reference,
	 * but that purchaseSchedule will not be removed from table
	 * purchaseSchedule,This method remove all purchasSchedule that are not
	 * referenced by any product.
	 */
	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = RuntimeException.class)
	public void cleanPurchaseSchedule();
}
